package com.Liux.dao;

import com.Liux.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    //查询所有用户
    @Select("select id,name,pwd as password from user")
    List<User> getUserList();

    @Select("select * from user where id=#{uid}")
    List<User> getUsersById(@Param("uid") int id);

    @Insert("insert into user(id,name,pwd) value(#{id},#{name},#{password})")
    int addUser(User user);

    @Update("update user set name=#{name},pwd=#{password} where id=#{id}")
    int UpdateUser(User user);

    @Delete("delete from user where id=#{id}")
    int delUser(@Param("id") int id);
}
